
import java.util.Observable;
import java.util.Observer;
public class Friends implements Observer {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void update(Observable o, Object arg) {
        Trends trends = new Trends();

        if (null != arg && arg instanceof Trends) {
            trends = (Trends) arg;

        }
        System.out.println(this.getName() + "你好，收到了来自" + trends.getNickName() + "的动态【" + trends.getContent() + "】");
    }
}